package day4.liberary.operator;

import day4.liberary.book1.booklist;
import day4.liberary.book1.book;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: watermelon
 * Date: 2025-05-30
 * Time: 22:48
 */
public class addbook implements Job{
    @Override
    public void working(booklist list) {
        Scanner scanner=new Scanner(System.in);
        System.out.print("请输入书名:");
        String newname=scanner.next();
        System.out.print("请输入作者:");
        String newauthor=scanner.next();
        System.out.print("请输入价格:");
        int newprice=scanner.nextInt();
        System.out.print("请输入类型:");
        String newtype=scanner.next();
        book newbook=new book(newname,newauthor,newprice,newtype);
        list.booklist[list.capacity]=newbook;
        list.capacity++;
    }
}
